<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>合众人寿公益平台客户管理系统</title>
		 <meta http-equiv="pragma" content="no-cache">
			<meta http-equiv="cache-control" content="no-cache">
			<meta http-equiv="expires" content="0">    
			<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
			<meta http-equiv="description" content="This is my page">
		<SCRIPT type="text/javascript">
	      var GB_ROOT_DIR = "<%=request.getContextPath()%>/html/skin/";
        </SCRIPT>	
		<style>
body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th {
	margin: 0;
	padding: 0;
	font-family: "宋体", Arial, Helvetica, sans-serif;
}

li {
	list-style: none;
}

input {
	background: none;
}

.clear {
	zoom: 1;
}

.clear:after {
	content: "";
	display: block;
	clear: both;
}
</style>
		<link href="<%= request.getContextPath() %>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/html/css/gb_styles.css"
			rel="stylesheet" type="text/css"/>
		<script src="<%=request.getContextPath()%>/html/js/Calendar.js"
			charset="utf-8"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS_fx.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/gb_scripts.js"></script>
		
		<link href="<%= request.getContextPath() %>/html/css/tree.css"
			rel="stylesheet" type="text/css" />
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/PopupCalendar.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/prototype.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/buffalo.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/pims.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/xtree.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/xloadtree.js"></script>
		
		<!-- Dwr Js -->
		<script
			src="<%= request.getContextPath() %>/dwr/interface/organizationAction.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/dwr/engine.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/dwr/util.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/html/js/subCityUtil.js"
			type="text/javascript"></script>
		 <link href="<%=request.getContextPath()%>/html/js/My97DatePicker/skin/WdatePicker.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=request.getContextPath()%>/html/js/My97DatePicker/WdatePicker.js"
			charset="utf-8"></script>
	</head>
	 
	<body>
	 <input type="hidden" value="${impDataInfor}" id="impDataInfor">
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							会员列表
						</h3>
					</div>
					<div class="ct">
						<form
							action="<%=request.getContextPath()%>/member/searchMembers.do"
							method="post" onsubmit="return check()" name="listForm">
							<h3 class="sm_tt">
								查询条件
							</h3>
							<div class="tiaojian">
								 <ul class="clear">
										<li>
											<span>分公司：</span>
											<select name="member.subCompany" onchange="ajaxSubmit()"
											id="subCompany">
												<option selected="selected" value="No">
													不限
												</option>
												<s:iterator value="#session.barchList" var="organ">
													<option value="<s:property value="#organ.um_organ_id" />"
													         <c:if test="${member.subCompany eq organ.um_organ_id }">selected</c:if> >
														<s:property value="#organ.abbr_name" />
													</option>
												</s:iterator>
											</select>
										</li>
										<li>
											<span>中支：</span>
											<select name="member.subCity" id="subCity">
												<option selected="selected" value="No">
													不限
												</option>
												<s:iterator value="#session.expensedList" var="organ">
												<option value="<s:property value="#organ.um_organ_id" />"
													<c:if test="${member.subCity eq organ.um_organ_id }">selected</c:if>>
													<s:property value="#organ.abbr_name" />
												</option>
											  </s:iterator> 
											</select>
												<input type="hidden" value="${subCityHidden}" name="subCityHidden" id="subCityHidden" />
										</li>
										<li>
											<span>性别：</span>
											<select name="member.gender">
												<option value="No">
													不限
												</option>
												<option value="男" <c:if test="${member.gender eq '男' }">selected</c:if>>
													男
												</option>
												<option value="女" <c:if test="${member.gender eq '女' }">selected</c:if>>
													女
												</option>
											</select>
										</li>
										 
									 
										<li>
											<span>出生日期：</span>
											<input type="text" name="startbirthday" id="startbirdate"  onfocus="WdatePicker({startbirdate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${startbirdate}"/>
										</li>
										<li>
											<span>至：</span>
											<input type="text" name="endbirthday" id="endbirdate"  onfocus="WdatePicker({endbirdate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${endbirdate}"/>
										</li>
										
										<li>
											<span>会员类型：</span>
											<select name="member.memberType">
												<option selected="selected" value="No">
													不限
												</option>
												<option value="绿卡会员" <c:if test="${member.memberType eq '绿卡会员' }">selected</c:if>>
													绿卡会员
												</option>
												<option value="银卡会员" <c:if test="${member.memberType eq '银卡会员' }">selected</c:if>>
													银卡会员
												</option>
												<option value="金卡会员" <c:if test="${member.memberType eq '金卡会员' }">selected</c:if>>
													金卡会员
												</option>
												<option value="金箔卡会员" <c:if test="${member.memberType eq '金箔卡会员' }">selected</c:if>>
													金箔卡会员
												</option>
												<option value="钻石卡会员" <c:if test="${member.memberType eq '钻石卡会员' }">selected</c:if>>
													钻石卡会员
												</option>
											</select>
										</li>
										 <li>
										    <span>产生时间：</span>
										    <input type="text" name="startcreate" id="startcreate" onfocus="WdatePicker({startcreate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${startcreate}"/>
										 </li>
										 <li>
										    <span>至：</span>
										    <input type="text" name="endcreate" id="endcreate"  onfocus="WdatePicker({endcreate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${endcreate}"/>
										 </li>
										<li>
										    <span>车辆品牌：</span>
										    <input type="text" name="member.carBrand"  class="txt" value="${member.carBrand}"/>
										 </li>
										 <li>
										    <span>姓名：</span>
										    <input type="text" name="member.memberName" class="txt" value="${member.memberName}"/>
										 </li>
								 </ul>
									 
								<div class="btn">
									<input type="submit" value="查询" name = "search" onclick="setButtonType(this)"/>
								</div>
                                      <input type="hidden" id="buttonType" name="buttonType">
							</div>
							<c:if test="${roleName eq 'ADMIN'}">
							<div class="btn2">
								<input type="button" value="批量导出" name="exp" onclick="setButtonType(this)" />
							</div>
							
							</c:if>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getStart('会员列表', #request.pm)"
								escape="false" />
							<div class="jieguo" >
								<table border="0" cellpadding="0" cellspacing="0"
									class="listArea" width="100%" >
									<thead>
										<tr>
										    <th>
										                   分公司
										    </th>
										    <th>
										                    中支
										    </th>
											<th>
												姓名
											</th>
											<th>
												性别
											</th>
											<th>
												出生日期
											</th>
											<th>
												会员类型
											</th>
											<th>
												身份证号
											</th>
											<th>
												手机号码
											</th>
											<th>
												电子邮件
											</th>
											<th>
												创建时间
											</th>
											<th>
												操作
											</th>
										</tr>
									</thead>
									<tbody id="bg" >
										<s:if test="#request.pm.datas.size()==0">
											<tr>
												<td colspan="14" align="center">
													<font color="red">暂无数据！</font>
												</td>
											</tr>
										</s:if>
										<s:else>
											<s:iterator value="#request.pm.datas" var="member"
												status="status">
												<s:if test="#status.odd == true">
													<tr class="rowNormal"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowNormal'">
												</s:if>
												<s:else>
													<tr class="rowAlternate"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowAlternate'">
												</s:else>
													<td width="110px">
													<div class="autoSubComName"
														title="<s:property value="#member.subComName" />">
														<s:property value="#member.subComName" />
													</div>
												</td>
												<td width="100px">
													<div class="autoSubCityName"
														title="<s:property value="#member.subCityName" />">
														<s:property value="#member.subCityName" />
													</div>
												</td>
													<td align="center">
														<s:property value="#member.memberName" />
													</td>
													<td align="center">
														<s:property value="#member.gender" />
													</td>
													<td align="center">
													    <s:if test="#member.birthday == null || #member.birthday.length() == 0">&nbsp;</s:if>
														<s:property value="#member.birthday" />
													</td>
													<td align="center">
														<s:property value="#member.memberType" />
													</td>
													<td width="100px">
													<div class="autoSubCityName"
														title="<s:property value="#member.idCard" />">
														<s:property value="#member.idCard" />
													</div>
												</td>
													<td align="center">
														<s:property value="#member.cellPhone" />
													</td>
													<td align="center">
													   <s:if test="#member.email == null || #member.email.length() == 0">&nbsp;</s:if>
														<s:property value="#member.email" />
													</td>
													<td width="100px">
													<div class="autoSubCityName"
														title="<s:property value="#member.createDate" />">
														<s:date name="#member.createDate" format="yyyy-MM-dd HH:mm:ss"/>
													</div>
												   </td>
													<td align="center">
														<a
															href="<%=request.getContextPath()%>/member/viewMember.do?member.id=<s:property value="#member.id"/>">查看</a>
														<a
															href="<%=request.getContextPath()%>/member/updateMember.do?member.id=<s:property value="#member.id"/>">修改</a>
														<a
															href="javascript:deleteMember(<s:property value="#member.id"/>);">删除</a>
													</td>
												</tr>
											</s:iterator>
										<tr>
										  <td colspan="11" align="center">
										     会员数量共 <s:property value="#request.pm.total" /> 位
										  </td>
										</tr>
										</s:else>
									</tbody>
								</table>
							</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getEnd(#request.pm)"
								escape="false" />
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
	   <%
	 String rolename = (String)session.getAttribute("rolename");
	 if(!"THIRDADMIN".equals(rolename)){
	%>
    ajaxSubmit();
    <%}%>
	
    function deleteMember(id){
  		if(confirm("是否确认删除？")){
  			window.location.href="<%=request.getContextPath()%>/member/deleteMember.do?member.id="+id;
  		}
  	}
  	 var impDataInfor = document.getElementById("impDataInfor").value;
  	if(impDataInfor != ''){
  		 GB_showCenter("导入会员信息","<%=request.getContextPath()%>/jsp/member/impDataInfor.jsp?impDataInfor=${impDataInfor}",300,300);
  		document.getElementById("impDataInfor").value = '';
  	}
  </script>
</html>
